﻿using Informant.Clients.ViewModels.Wpf4;
using Informant.Clients.Views;

namespace Informant.Clients.UI.Wpf4
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : IViewContainer
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="MainWindow"/> class.
		/// </summary>
		public MainWindow()
		{
			InitializeComponent();
		}

		#region IViewContainer Members

		/// <summary>
		/// Navigates to the specified view.
		/// </summary>
		/// <param name="view">The view.</param>
		public void Navigate(IView view)
		{
			Content = view;
			//HACK: Should not initialize VM here.
			var smsView = view as SmsMessagingView;
			if (smsView != null)
			{
				var vm = smsView.DataContext as SmsMessagingViewModel;
				if (vm != null)
				{
					vm.Initialize();
				}
			}
		}

		#endregion
	}
}
